﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace DAL
{
	// Giải pháp tổng quát, dùng cho mọi lớp entity
	public interface IGeneralRepository<T> where T : class
	{
		T GetById(params object[] keys);
		IQueryable<T> All();
		IQueryable<T> Find(Expression<Func<T, bool>> predicate);
		void BulkInsert(IEnumerable<T> entities);
		int AddWithIdentity(T entity);
		bool Add(T entity); 
		bool InsertOrUpdate(T entity);
		bool Update(T entity);
        bool Update(Expression<Func<T, bool>> predicate,Expression<Func<T, T>> fc);
        bool Update( Expression<Func<T, T>> fc);
		bool Delete(T entity);
        bool Delete(Expression<Func<T, bool>> predicate);
		object GetData(string sprocOrQuery, bool isStoredProc);
	
	}
}
